package com.yobol.jgrowth.mapper;

import com.yobol.jgrowth.domain.Article;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

@Mapper
@Component
public interface ArticleMapper {

    int insert(Article article);

    List<Article> getArticlesByTag(String tag);

    List<Article> getArticlesByTagRank(@Param("tag") String tag,@Param("num") int num);

    List<Article> getArticlesByUsername(String username);

    Article getArticleByAid(int aid);

    int deleteArticleByAid(int aid);

    int updateArticleByPrimaryKey(Article article);

    List<Article> getArticlesByKeywords(String keywords);

    int updateArticleCommentedCtr(Article article);

    int updateArticleScannedCtr(Article article);

    List<Article> getArticlesByCtrRatio(int num);
}